<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-sys__user">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.memchantName" placeholder="商户名称" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-input v-model="dataForm.paymentName" placeholder="商品名称" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList(1)">查询</el-button>
        </el-form-item>
      </el-form>
      <el-table
          v-loading="dataListLoading"
          :data="dataList"
          border
          size="mini"
          :height="tableHeight"
          @selection-change="dataListSelectionChangeHandle"
          @sort-change="dataListSortChangeHandle"
          style="width: 100%;">
        <el-table-column prop="orderBillsSn" label="缴费单号" sortable="custom" header-align="center" align="center" width="140px"></el-table-column>
        <el-table-column prop="outTradeSn" label="流水号" sortable="custom" header-align="center" align="center" width="220px"></el-table-column>
        <el-table-column prop="paymentName" label="商品名称" sortable="custom" header-align="center" align="center"  width="400px"></el-table-column>
        <el-table-column prop="memchantName" label="商户名称" header-align="center" align="center" width="200px"></el-table-column>
        <el-table-column prop="payPrice" label="支付金额(元)" sortable="custom" header-align="center" align="center"></el-table-column>
        <el-table-column prop="statusName" label="响应平台" sortable="custom" header-align="center" align="center"  :show-overflow-tooltip="true"></el-table-column>
        <el-table-column prop="params" label="接收参数" sortable="custom" header-align="center" align="center" >
          <template slot-scope="scope">
            <el-popover trigger="hover" placement="top">
              <p><span style=""></span>金额: {{ scope.row.payVO.totalAmount }} (元)</p>
              <p>缴费单号: {{ scope.row.payVO.orutTradeNo }}</p>
              <p>商品名称: {{ scope.row.payVO.subject }}</p>
              <p>支付渠道: {{ scope.row.payVO.channel }}</p>
              <p>同步地址: {{ scope.row.payVO.returnUrl }}</p>
              <p>异步地址: {{ scope.row.payVO.notifyUrl }}</p>
              <p v-if="scope.row.payVO.openid">公众号OPENID: {{ scope.row.payVO.openid }}</p>
              <p>商品备注: {{ scope.row.payVO.body }}</p>
              <div slot="reference" class="name-wrapper sl_text">
                <span class="sl_text">{{ scope.row.params}}</span>
              </div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column prop="status" label="状态" sortable="custom" header-align="center" align="center">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.status === '1'" size="mini" type="success">成功</el-tag>
            <el-tag v-if="scope.row.status === '2'" size="mini" >发起</el-tag>
            <el-tag v-if="scope.row.status === '3'" size="mini" >平台发起</el-tag>
            <el-tag v-if="scope.row.status === '4'" size="mini" >第三方响应</el-tag>
            <el-tag v-if="scope.row.status === '5'" size="mini" >平台响应</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="支付时间" sortable="custom" header-align="center" align="center"  width="180"></el-table-column>
      </el-table>
      <el-pagination
          :current-page="current"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="pageSize"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="pageSizeChangeHandle"
          @current-change="pageCurrentChangeHandle">
      </el-pagination>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/log/list',
        getDataListIsPage: true
      },
      dataForm: {
        merchantId: this.$store.state.user.merchantId ? this.$store.state.user.merchantId : 0,
        paymentName: '',
        memchantName: ''
      }
    }
  },
  methods: {
    setString () {
      return 'sss'
    }
  },
  components: {
  }
}
</script>
<style scoped lang="scss">
  .sl_text{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
</style>
